//
//  TagsCell.m
//  HAODE
//
//  Created by panquanReabam.com on 16/5/10.
//  Copyright © 2016年 reabam.com. All rights reserved.
//

#import "TagsCell.h"

@interface TagsCell()


@property(nonatomic,strong)UILabel *userName;

@property(nonatomic,strong)UIImageView*Seximage;
@property(nonatomic,strong)UILabel *lineLabel;



@end
@implementation TagsCell

- (void)awakeFromNib {
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        //self.backgroundColor = [UIColor colorWithRed:231/255.0 green:231/255.0 blue:231/255.0 alpha:1];
        
        [self createView];
        [self setViewAutoLayout];
    }
    
    return self;
    
}
-(void)createView
{
    
    self.userName=[[UILabel alloc]initWithFrame:CGRectMake(120, 0, 100, 55)];
    self.userName.font= [UIFont systemFontOfSize:17];
    self.userName.textColor=[UIColor colorWithRed:51/255.0f green:51/255.0f blue:51/255.0f alpha:1.0];
    [self addSubview:self.userName];
    self.Seximage=[[UIImageView alloc] init];
    [self addSubview:self.Seximage];
    
    
       
    
    self.lineLabel=[[UILabel alloc] init];
    [self.lineLabel setBackgroundColor:[UIColor colorWithRed:238.0f/255.0f green:238.0f/255.0f blue:238.0f/255.0f alpha:1.0f]];
    self.lineLabel.textColor=[UIColor clearColor];
    [self addSubview:self.lineLabel];
    
}
-(void)setModel:(MemberListModel *)model
{
    
    self.userName.text=[NSString stringWithFormat:@"%@ (%@)",  @"sdd",model.typeName];
    
    self.lineLabel.text=[NSString stringWithFormat:@"%@",model.typeName];
    if (![model.sex  isEqual:[NSNull null]]) {
        
        if ([model.sex isEqualToString:@"男"]) {
            self.Seximage.image=[UIImage imageNamed:@"nan"];
        }else{
            self.Seximage.image=[UIImage imageNamed:@"nv"];
        }
    }else{
        self.Seximage.image=[UIImage imageNamed:@"nv"];
    
    
    

}}


-(void)setViewAutoLayout
{
//    [self.userName mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.mas_left).with.offset(55) ;
//        make.height.equalTo(@16);
//        make.top.equalTo(self.mas_top).with.offset(5);
//    }];
//    
//    [self.Seximage mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self.userName.mas_right).with.offset(3);
//        make.width.equalTo(@20);
//        
//        make.height.equalTo(@20);
//        
//        make.top.equalTo(self.mas_top).with.offset(25);
//    }];
    [self.lineLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).with.offset(10);
        make.right.equalTo(self.mas_right).with.offset(-10) ;
        
        make.height.equalTo(@1);
        
        make.top.equalTo(@55).with.offset(0);
    }];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
